/**
 * nghilt
 * 2011/09/26
 */
package at.com.vn.chess.entity;

import vn.nnn.shogi.quanco.QuanCo;
import at.com.vn.chess.util.Const;

/**
 * 
 */
public class ChessBoardInfo {
	
	private String uId;
	private String chatMsg;
	private Integer isAct;
	private Integer isDeleted;
	private Integer isTOwner;
	
	private String rId;
	private Integer tId;
	private String status;
	
	public Integer turn;
	public Integer x;
	public Integer y;
	public Integer color;
	public String name;
	public Integer isTB;
	public Integer whosWon;
	
	String bName;
	String wName;
	Integer bRemainT;
	Integer wRemainT;
	
	public ChessBoardInfo() {
		super();
		
		this.uId = "";
		this.chatMsg = "";
		this.isAct = 0;
		this.isDeleted = 0;		
		this.isTOwner = Const.FALSE;
		this.rId = "";
		this.tId = 0;
		
		this.status = Const.STATUS_IDLE;
		this.turn = Const.UNDEFINE_VALUE;
		this.x = 0;
		this.y = 0;
		this.color = Const.UNDEFINE_VALUE;
		this.name = "";
		this.isTB = Const.FALSE;
		this.whosWon = Const.UNDEFINE_VALUE;
		
		this.bName = "";
		this.wName = "";
		this.bRemainT = 0;
		this.wRemainT = 0;
	}
	
	public ChessBoardInfo( String status, int turn, int whosWon, ChatUser user, QuanCo quanCo ) {
		this();
		this.uId = user.getUserID();
		this.chatMsg = user.getChatMsg();
		this.isAct = user.getIsActive();
		this.isDeleted = user.getIsDeleted();		
		this.rId = user.getRoomID();		
		this.tId = user.getPrivateRoomID();
		
		
		this.status = status;
		this.turn = turn;
		this.x = quanCo.getX();
		this.y = quanCo.getY();
		this.color = quanCo.color;
		this.name = quanCo.getClass().getSimpleName();
		
		if( quanCo.isTuBinh ) {
			this.isTB = Const.TRUE;	
		}else {
			this.isTB = Const.FALSE;
		}
		this.whosWon = whosWon;
		
		this.bName = "";
		this.wName = "";
		this.bRemainT = Const.COUNT_DOWN_START_POINT_TOTAL;
		this.wRemainT = Const.COUNT_DOWN_START_POINT_TOTAL;		
	}
	
	public ChessBoardInfo( String status, int turn, String bName, String wName, int bRemainT, int wRemainT, int whosWon, ChatUser user, int isTablesOwner, QuanCo quanCo ) {
		this( status, turn, whosWon, user, quanCo );
		
		this.isTOwner = isTablesOwner;
		this.bName = bName;
		this.wName = wName;
		this.bRemainT = bRemainT;
		this.wRemainT = wRemainT;			
	}

	public String getUId() {
		return uId;
	}

	public void setUId( String uId ) {
		this.uId = uId;
	}

	public String getChatMsg() {
		return chatMsg;
	}

	public void setChatMsg( String chatMsg ) {
		this.chatMsg = chatMsg;
	}

	public Integer getIsAct() {
		return isAct;
	}

	public void setIsAct( Integer isAct ) {
		this.isAct = isAct;
	}

	public Integer getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted( Integer isDeleted ) {
		this.isDeleted = isDeleted;
	}

	public String getRId() {
		return rId;
	}

	public void setRId( String rId ) {
		this.rId = rId;
	}

	public Integer getTId() {
		return tId;
	}

	public void setTId( Integer tId ) {
		this.tId = tId;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus( String status ) {
		this.status = status;
	}

	public Integer getTurn() {
		return turn;
	}

	public void setTurn( Integer turn ) {
		this.turn = turn;
	}

	public Integer getX() {
		return x;
	}

	public void setX( Integer x ) {
		this.x = x;
	}

	public Integer getY() {
		return y;
	}

	public void setY( Integer y ) {
		this.y = y;
	}

	public Integer getColor() {
		return color;
	}

	public void setColor( Integer color ) {
		this.color = color;
	}

	public String getName() {
		return name;
	}

	public void setName( String name ) {
		this.name = name;
	}

	public Integer getIsTB() {
		return isTB;
	}

	public void setIsTB( Integer isTB ) {
		this.isTB = isTB;
	}

	public Integer getWhosWon() {
		return whosWon;
	}

	public void setWhosWon( Integer whosWon ) {
		this.whosWon = whosWon;
	}

	public String getBName() {
		return bName;
	}

	public void setBName( String bName ) {
		this.bName = bName;
	}

	public String getWName() {
		return wName;
	}

	public void setWName( String wName ) {
		this.wName = wName;
	}

	public Integer getBRemainT() {
		return bRemainT;
	}

	public void setBRemainT( Integer bRemainT ) {
		this.bRemainT = bRemainT;
	}

	public Integer getWRemainT() {
		return wRemainT;
	}

	public void setWRemainT( Integer wRemainT ) {
		this.wRemainT = wRemainT;
	}

	public Integer getIsTOwner() {
		return isTOwner;
	}

	public void setIsTOwner( Integer isTOwner ) {
		this.isTOwner = isTOwner;
	}
}
